package cloud.daodao.storm.common.security.model.secret;

import cloud.daodao.storm.common.serialize.Serializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;

/**
 * @author DaoDao
 */
@Schema(title = "RsaUpsert", description = "RSA 写入")
@Data
public class RsaUpsert implements Serializer {

    @Schema(title = "id", description = "id", example = "1")
    @NotEmpty
    @Size(min = 18, max = 18)
    @Pattern(regexp = "^\\d+$")
    private String id;

    @Schema(title = "对方公钥，客户端公钥", description = "对方公钥，用于我方处理对方的数据时的加密和验签，由对方生成，密送予我方，私密保管", example = "1")
    @NotEmpty
    @Size(min = 1, max = 1024)
    private String clientPublicKey;

    @Schema(title = "valid", description = "是否有效", example = "true")
    private Boolean valid;

}
